#include <stdio.h>

int main(int argc, char *argv[])
{
	int m, s, t;
	int i, s1 = 0, s2 = 0;

	scanf("%d %d %d", &m, &s, &t);

	for (i=1; i<=t; i++) {
		s1 += 17;
		if (m >= 10) {
			m -= 10;
			s2 += 60;
		} else {
			m += 4;
		}
		if (s2 > s1) s1 = s2;
		if (s1 > s) {
			printf("Yes\n%d\n", i);
			break;
		}
	}

	if (i > t) printf("No\n%d\n", s1);

	return 0;
}
